package com.itheima.controller;

import com.itheima.pojo.CartInfo;
import com.itheima.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController

public class CartController {
//第二题
    @Autowired
    private CartService cartService;

    @GetMapping("/carts")
    public List<CartInfo> findAll(){
        return cartService.findAll();
    }
}
